package com.edu.hbwe.book.dao;

import java.sql.SQLException;
import java.util.List;

import com.edu.hbwe.book.entity.Product;
import com.edu.hbwe.book.exception.AddProductException;

public interface ProductDao {
    //后台添加商品
	public void addProduct(Product p) throws SQLException;

	public List<Product> listAll() throws SQLException;

	public List<Object[]> getWeekHotProduct() throws SQLException;

	public void deleteProduct(String id) throws SQLException;

	public Product findProductById(String id)throws SQLException;

	public int findAllCount(String category) throws SQLException;

	public List<Product> findByPage(int currentPage, int currentCount, String category) throws SQLException;

	public int findBookByNameAllCount(String searchfield) throws SQLException;

	public List<Product> findBookByName(int currentPage, int currentCount, String searchfield) throws SQLException;

	public List<Product> findProductByManyCondition(String id, String name, String category, String minprice,
			String maxprice)throws SQLException;

	public void editProduct(Product p) throws SQLException;

}
